/**
 * 
 */
package com.msmall.community.team.model;

import java.util.Date;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.msmall.base.model.BaseObject;

/**
 * @author zhzy
 * 组
 */
@Entity
@Table(name="team")
public class Team extends BaseObject{

	private static final long serialVersionUID = 7281461628449651088L;
	
	public static final Integer STATUS_TOBE_AUDIT = 1;
	public static final Integer STATUS_AUDIT_FAILURE = 2;
	public static final Integer STATUS_NORMAL = 3;
	public static final Integer STATUS_CLOSED = 4;
	
	public static final Integer RANK_NORMAL = 1;
	@Id
	@Column(name="teamid")
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Long teamid;
	
	//组名
	@Column(name="name")
	private String name;
	//组描述
	@Column(name="description")
	private String description;
	
	//组等级
	@Column(name="rank")
	private Integer rank;
	
	//组人数
	@Column(name="member_count")
	private Integer memberCount;
	//组状态  1等待审核 2审核未通过 3正常 4关闭
	@Column(name="status")
	private Integer status;
	
	@Column(name="logo")
	private String logo; // 组LOGO图片路径

	//创建日期
	@Column(name="create_time")
	@Temporal(TemporalType.TIMESTAMP)
	private Date createTime;
	
	@OneToMany(cascade = {CascadeType.PERSIST,CascadeType.MERGE},fetch=FetchType.EAGER, mappedBy="team")
	private Set<TeamProperty> properties;

	public Long getTeamid() {
		return teamid;
	}

	public void setTeamid(Long teamid) {
		this.teamid = teamid;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Integer getRank() {
		return rank;
	}

	public void setRank(Integer rank) {
		this.rank = rank;
	}

	public Integer getMemberCount() {
		return memberCount;
	}

	public void setMemberCount(Integer memberCount) {
		this.memberCount = memberCount;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public String getLogo() {
		return logo;
	}

	public void setLogo(String logo) {
		this.logo = logo;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Set<TeamProperty> getProperties() {
		return properties;
	}

	public void setProperties(Set<TeamProperty> properties) {
		this.properties = properties;
	}

	@Override
	public boolean equals(Object o) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public int hashCode() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return null;
	}
}
